<!DOCTYPE html>
<html>
<head>
    <title>work_params</title>
    <#include "/sys/header.html"/>
</head>
<body>
<div class="panel panel-default" id="rrapp" v-cloak>
    <div class="panel-heading">{{title}}</div>
    <form class="form-horizontal">
        <div class="form-group">
            <div class="col-sm-2 control-label">参数名称</div>
            <div class="col-sm-10">
                <input type="text" class="form-control" v-model="workParams.paramKey" placeholder="参数名称"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">类型</div>
            <div class="col-sm-10">
                <select class="form-control" v-model="workParams.type" placeholder="类型 1 值 2 sql">
                    <template v-for="option in paramTypes">
                        <option :value="option.dictCode" v-if="option.dictCode == workParams.type" selected>
                            {{ option.dictName }}
                        </option>
                        <option :value="option.dictCode" v-else>
                            {{ option.dictName }}
                        </option>
                    </template>
                </select>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">参数值</div>
            <div class="col-sm-10">
		      <textarea rows="20" class="form-control" v-model="workParams.paramValue"
                        placeholder="参数值  类型=值，值  类型=sql，通过sql算出值">
			  </textarea>
                <div class="alert alert-info" style="margin:10px 0 0 0">
                    <ul style="padding:0 0 0 20px;">
                        <li>当sql中字段为日期类型时，请转换为字符串</li>
                        <li>示例：select DATE_FORMAT(CURDATE(),'%Y-%m-%d') today from dual</li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">数据库key</div>
            <div class="col-sm-10">
                <select class="form-control" v-model="workParams.dbKey">
                    <template v-for="option in dbKeys">
                        <option :value="option.dictCode" v-if="option.dictCode == workParams.type" selected>
                            {{ option.dictName }}
                        </option>
                        <option :value="option.dictCode" v-else>
                            {{ option.dictName }}
                        </option>
                    </template>
                </select>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label"></div>
            <input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
            &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="back" value="返回"/>
        </div>
    </form>
</div>

<script src="${base}/js/work/workParams_add.js?_${.now?string['yyyyMMddhhmmSS']}"></script>
</body>
</html>
